package xinxin.com.AbstractFactoryPattern;

import xinxin.com.AbstractFactoryPattern.DataObject.Department;
import xinxin.com.AbstractFactoryPattern.Factory.FactoryDetail.AccessFactory;
import xinxin.com.AbstractFactoryPattern.Factory.IFactory;
import xinxin.com.AbstractFactoryPattern.Sql.IDepartment;
import xinxin.com.AbstractFactoryPattern.Sql.IUser;
import xinxin.com.AbstractFactoryPattern.DataObject.User;
import xinxin.com.AbstractFactoryPattern.Sql.SqlDetail.AccessDepartment;
import xinxin.com.AbstractFactoryPattern.Sql.SqlDetail.SqlserverDepartment;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/3/25 20:26
 */
public class AbstractFactoryPattern {
    public static void main(String[] args) {
        User user = new User();
        Department department = new Department();

        IFactory factory = new AccessFactory();

        IUser iUser = factory.CreateUser();
        iUser.Insert(user);
        iUser.GetUser(1);

        IDepartment iDepartment = factory.CreateDepartment();
        iDepartment.Insert(department);
        iDepartment.GetDepartment(1);
    }
}
